From: Carlos Garnacho Date: Tue, 27 Feb 2018 13:20:47 +0000 (+0100) Subject: shell-global: Do not deal with allocated strings as const char X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~970^2^2~29 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=4a17c8f4a93f2eef41c9afa8d8fec06d240091ec;p=gnome-shell.git shell-global: Do not deal with allocated strings as const char The imagedir and userdatadir variables are not fetched from constants/environment but created with g_strdup*/g_build*. Acknowledge that and also free the strings in finalize. --- diff --git a/src/shell-global.c b/src/shell-global.c index 6eee3756b..c67ac4e4a 100644 --- a/src/shell-global.c +++ b/src/shell-global.c @@ -73,8 +73,8 @@ struct _ShellGlobal { ShellWM *wm; GSettings *settings; const char *datadir; - const char *imagedir; - const char *userdatadir; + char *imagedir; + char *userdatadir; GFile *userdatadir_path; GFile *runtime_state_path; @@ -337,6 +337,10 @@ shell_global_finalize (GObject *object) g_clear_object (&global->userdatadir_path); g_clear_object (&global->runtime_state_path); + g_free (global->session_mode); + g_free (global->imagedir); + g_free (global->userdatadir); + G_OBJECT_CLASS(shell_global_parent_class)->finalize (object); }